{  Statement: http://acmp.ru/?main=task&id_task=357
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    i,ls,x,y:longint;
    s:string;
    
begin
reset(input, 'input.txt');
rewrite(output, 'output.txt');
readln(s);
ls := length(S);
x := 0;
y := 0;
for i := 1 to ls do
    if odd(i) then inc(y, ord(s[i]) - 48) else inc(x, ord(s[i]) - 48);
if (x - y) mod 11 = 0 then write('YES') else write('NO');
end.
